import React from 'react';
import { Router, Route, Switch, Redirect } from 'dva/router';
// import IndexPage from './routes/IndexPage';
import MainPage from './routes/MainPage';
import IndexPage from './routes/IndexPage';


function RouterConfig({ history }) {
  return (
    <Router history={history}>
      <Switch>
        {/* <Route path="/" exact component={MainPage} /> */}
        <Route path='/' exact render={() => (
          <Redirect to='/login' />
        )} />
        <Route path="/login" component={MainPage} />
        <Route path="/index" component={IndexPage} />
      </Switch>
    </Router>
  );
}

export default RouterConfig;
